﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class XuanzhuanAnimation : MonoBehaviour {

    public float f_jiaodu = 300.0f;      //每次旋转的角度
    public Transform tf_xuanzhuananniu;

	// Use this for initialization
	void Start () {
        EventManager<string>.AddEvent(MyEventType.OnllyXuanzhuan,Xuanzhuan);
	}

    void Xuanzhuan(string dir) {
        if (!OnllyUIController._instance.b_isHeiPing)
        {
            if (dir == "shun")
            {
                tf_xuanzhuananniu.Rotate(Vector3.forward, Time.deltaTime * f_jiaodu);
            }
            else if (dir == "ni")
                tf_xuanzhuananniu.Rotate(-Vector3.forward, Time.deltaTime * f_jiaodu);
        }
    }
}
